import service, { get, post,deleteRequest } from '@/utils/request';
const servletMap = [
	// [ '/web/uc/skuOrder/findOrderAvailableCodeList', 'findOrderAvailableCodeList' ],
	// [ '/web/uc/ajax/queryAreaListByParentId', 'queryAreaListByParentId' ],
	// [ '/web/uc/order/getUserAddressList', 'getUserAddressList' ],

	// ['/web/uc/ajax/saveUserAddress','saveUserAddress'],
	// ['/web/uc/skuOrder/checkout','checkout'],
	// [ '/web/uc/skuOrder/getOrderDetail', 'getOrderDetail' ],


	['/order/or/order/user-order','getOrderList','get'],
	// 分销模式创建订单必须传入分享人链接
	['/order/or/order/create-order','createOrder','post'],
	['/order/or/order/apply-refund','applyRefund','post'],
	['/order/or/order/user-delete','deleteOrder','delete'],
	['/order/pay/sign','sign','get'],
	['/order/pay/weixin-success-notify','notify','post'],

	
];
let obj = {};
for (let i in servletMap) {
	obj[servletMap[i][1]] = function() {
		return service[servletMap[i][2]](servletMap[i][0], ...arguments);
	};
}

export default {...obj,
	orderDetail:(params)=>get('/order/or/order/user-order-detail/'+params.orderId,params),
};
